/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.meuevento.business.user;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Lob;

/**
 *
 * @author Fernando Arena Varella
 */
@Embeddable
public class UserInfo implements Serializable {
    private static final long serialVersionUID = 1L;

    @Column
    private String firstName;
    @Column
    private String lastName;
    @Column
    private short age;

    @Column
    @Lob
    private byte[] photo;

    public short getAge() {
        return age;
    }

    public void setAge(short age) {
        this.age = age;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public byte[] getPhoto() {
        return photo;
    }

    public void setPhoto(byte[] photo) {
        this.photo = photo;
    }


    


    @Override
    public int hashCode() {
        int hash = 0;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof UserInfo)) {
            return false;
        }
        UserInfo other = (UserInfo) object;
        if ((this.firstName == null && other.firstName != null) || (this.firstName != null && !this.firstName.equals(other.firstName))) {
            if ((this.lastName == null && other.lastName != null) || (this.lastName != null && !this.lastName.equals(other.lastName))) {
                return false;
            }
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.meuevento.business.user.UserInfo[name=" + firstName + "]";
    }

}
